# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: M Rawash <mrawash@gmail.com>

pkgname=xf86-input-wacom
pkgver=1.2.0
pkgrel=1
pkgdesc="X.Org Wacom tablet driver"
arch=(loong64 x86_64)
url="https://github.com/linuxwacom/xf86-input-wacom"
license=(GPL)
depends=(libxi libxinerama libxrandr systemd-libs)
makedepends=('xorg-server-devel' 'X-ABI-XINPUT_VERSION=24.4' 'meson'
 	'gobject-introspection'
	# for tests
        'python-libevdev' 'python-pytest' 'python-yaml' 'python-gobject' 'attr')
conflicts=('xorg-server<21.1.1' 'X-ABI-XINPUT_VERSION<24' 'X-ABI-XINPUT_VERSION>=25')
source=(https://github.com/linuxwacom/xf86-input-wacom/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.tar.bz2{,.sig})
# check at https://github.com/linuxwacom/xf86-input-wacom/releases
sha256sums=('13c23208b2bc2bfd7b3a127ca667bb1399e54e3fcc22386ef1fb54be1d72685d'
            'SKIP')
#validpgpkeys=('9A12ECCC5383CA2AF5B42CDCA6DC66911B2127D5') # Jason Gerecke <killertofu@gmail.com>
validpgpkeys=('3C2C43D9447D5938EF4551EBE23B7E70B467F0BF') #  "Peter Hutterer (Who-T) <office@who-t.net>"
#validpgpkeys=('5222AA87620F928D2C16F62BDB4ABF7C3424190B') # "Aaron Armstrong Skomra <skomra@gmail.com>"
#validpgpkeys=('FBE078781106933D3DDCF93E5B4EA609784983CA') # "Jason Gerecke <jason.gerecke@wacom.com>"

build() {
  arch-meson $pkgname-$pkgver build \
    -D xorg-conf-dir=/usr/share/X11/xorg.conf.d/ \
    -D systemd-unit-dir=/usr/lib/systemd/system/ \
    -D unittests=enabled

  # Print config
  meson configure build
  ninja -C build
}

check() {
  meson test -C build # || /bin/true
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}
